package com.fita.entity.order.reverse.hotel;

import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Embeddable;
import java.util.Date;

/**
 * @description: 酒店预订
 * @author: 11200
 * @date: 2019/8/21
 */
@Embeddable
public class HotelBook {

    /**
     * 入住时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date checkInTime;

    /**
     * 离店时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date checkOutTime;

    /**
     * 房型
     */
    private String roomType;

    /**
     * 是否含早
     */
    private String hasBreakfast;

    /**
     * 成人数量
     */
    private Integer audltNumber;

    /**
     * 儿童数量
     */
    private Integer childNumber;

    private String remark;

    public HotelBook() {
    }


    /**
     *
     * @return
     */
    public boolean isValid() {

        if (checkInTime == null || checkOutTime == null){
            return false;
        }
        if (StringUtils.isAnyBlank(roomType, hasBreakfast)){
            return false;
        }
        return true;
    }

    public Date getCheckInTime() {
        return checkInTime;
    }

    public void setCheckInTime(Date checkInTime) {
        this.checkInTime = checkInTime;
    }

    public Date getCheckOutTime() {
        return checkOutTime;
    }

    public void setCheckOutTime(Date checkOutTime) {
        this.checkOutTime = checkOutTime;
    }

    public String getRoomType() {
        return roomType;
    }

    public void setRoomType(String roomType) {
        this.roomType = roomType;
    }

    public String getHasBreakfast() {
        return hasBreakfast;
    }

    public void setHasBreakfast(String hasBreakfast) {
        this.hasBreakfast = hasBreakfast;
    }

    public Integer getAudltNumber() {
        return audltNumber;
    }

    public void setAudltNumber(Integer audltNumber) {
        this.audltNumber = audltNumber;
    }

    public Integer getChildNumber() {
        return childNumber;
    }

    public void setChildNumber(Integer childNumber) {
        this.childNumber = childNumber;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

}
